package com.sunwayworld.dev.core.valueobject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class JspObject {

	private String vmPath;// 模版路径

	private Map context = new HashMap();

	public String jspPath;// 文件路径

	public ArrayList packages = new ArrayList();// import的包

	public String encoding = "GBK";

	public String title = "";

	public String keywords = "";

	public String description = "";

	// ///////////////
	public JspObject(String jspPath, String vmPath) {
		this.jspPath = jspPath;
		this.vmPath = vmPath;
	}

	/**
	 * 设置 关键字之外的 context 扩展用
	 * 
	 * @param key
	 * @param javaObject
	 */
	@SuppressWarnings("unchecked")
	public void putContext(String key, JavaObject javaObject) {

		context.put(key, javaObject);
		packages.add(javaObject.classFullName);

	}

	/**
	 * 设置 关键字之外的 context 扩展用
	 * 
	 * @param key
	 * @param javaObject[]
	 */
	@SuppressWarnings("unchecked")
	public void putContext(String key, JavaObject[] javaObjects) {

		context.put(key, javaObjects);
		if (null != javaObjects) {
			for (int i = 0, n = javaObjects.length; i < n; i++) {
				packages.add(javaObjects[i].classFullName);
			}
		}
	}

	public Map getContext() {
		return context;
	}

	public void setContext(Map context) {
		this.context = context;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getEncoding() {
		return encoding;
	}

	public void setEncoding(String encoding) {
		this.encoding = encoding;
	}

	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	public String getJspPath() {
		return jspPath;
	}

	public void setJspPath(String jspPath) {
		this.jspPath = jspPath;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getVmPath() {
		return vmPath;
	}

	public void setVmPath(String vmPath) {
		this.vmPath = vmPath;
	}

	public ArrayList getPackages() {
		return packages;
	}

	public void setPackages(ArrayList packages) {
		this.packages = packages;
	}

}
